package com.zlf.test;

import cn.org.rapid_framework.generator.GeneratorFacade;
import cn.org.rapid_framework.generator.GeneratorProperties;
import cn.org.rapid_framework.generator.provider.java.model.JavaClass;
import org.junit.Test;

import java.io.IOException;

/**
 * Created by Administrator on 2016/12/23.
 *
 * @author zlf
 */
public class Main {

    @Test
    public void test() throws Exception {

//        //模板路径
        String templatePath = "template";
        GeneratorFacade g = new GeneratorFacade();
        g.getGenerator().addTemplateRootDir(templatePath);
        //删除生成器的输出目录//
//        g.deleteOutRootDir();
//       g.deleteByAllTable();
//        g.deleteByAllTable();
        g.generateByTable("role");
        Runtime.getRuntime().exec("cmd.exe /c start"+ GeneratorProperties.getRequiredProperty("outRoot"));

    }

}
